#include "../engine/core.h"
#include "./BehaviorTree/BTLeafNode.h"
#include "./BehaviorTree/BehaviorTree.h"
#include "./BehaviorTree/BTBlackBoard.h"
#include "LogMgr.h"


//----------------------------------------------------------------------------------------------------------------------------
CBTLeafNode::CBTLeafNode()
: IBTNode( NULL )
{

}

//----------------------------------------------------------------------------------------------------------------------------
CBTLeafNode::CBTLeafNode( IBTNode *parent )
: IBTNode( parent )
{

}

//----------------------------------------------------------------------------------------------------------------------------
CBTLeafNode::~CBTLeafNode()
{

}

//----------------------------------------------------------------------------------------------------------------------------
IBTNode::_eNodeStatus CBTLeafNode::execute()
{
	mpBehaviorTree->_setCurrentNode( this );

	mNodeStatus = leafExecute();
	if ( mpBehaviorTree->getLogFlag() )
	{
		GAMELOGER->debug( "BehaviorTree,%s %d", mName.c_str(), mId );
	}
	return IBTNode::mNodeStatus;
}
